Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 21, 2025
@GuillaumeGomez GuillaumeGomez changed the title Intra doc link disambiguator tyalias prim [rustdoc] Correctly handle intra doc link when type alias disambiguator is passed for primitive Sep 21, 2025
@lolbinarycat
Copy link
Contributor

I've come to the conclusion that the type@ disambiguator is just weird. This is because it simultaneously refers to the type namespace in general, but also to type aliases specifically. If the two conflicting items are in the type namespace, it refers to type aliases, but outside of that, it refers to the type namespace in general.

This gets especially odd when you remember modules are in the type namespace, which means type@std::ops is completely valid.

None of this complexity is documented anywhere, so it's not clear if its intentional, but there are ui tests that expect it (eg. intra-doc/prim-methods-local.rs).

In any case, this PR brings the type alias x primitive conflict case in line with similar cases like type alias x struct, so I think it's a significant improvement.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 22, 2025

📌 Commit 5b154a7 has been approved by lolbinarycat

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 22, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 22, 2025
…mbiguator-tyalias-prim, r=lolbinarycat

[rustdoc] Correctly handle intra doc link when type alias disambiguator is passed for primitive

Fixes rust-lang#146855.

r? `@lolbinarycat`
bors added a commit that referenced this pull request Sep 22, 2025
Rollup of 7 pull requests

Successful merges:

 - #146632 (Fix uses of "adaptor")
 - #146775 (fixes for numerous clippy warnings)
 - #146802 (mbe: Simplifications and refactoring)
 - #146806 (add private module override re-export test)
 - #146866 ([rustdoc] Correctly handle intra doc link when type alias disambiguator is passed for primitive)
 - #146896 (rustc-dev-guide subtree update)
 - #146898 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
@jieyouxu
Copy link
Member

Failed in #146910 (comment).
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 23, 2025
@GuillaumeGomez
Copy link
Member Author

I actually don't think this is the right fix here. Better add a new disambiguator for type aliases.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 25, 2025
@GuillaumeGomez GuillaumeGomez deleted the intra-doc-link-disambiguator-tyalias-prim branch September 25, 2025 13:01
jhpratt added a commit to jhpratt/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc `@fmease`
r? lolbinarycat
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 26, 2025
…or, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang#146855.

Alternative to rust-lang#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
rust-timer added a commit that referenced this pull request Sep 27, 2025
Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lolbinarycat

Add new `tyalias` intra-doc link disambiguator

Fixes #146855.

Alternative to #146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 29, 2025
…binarycat

Add new `tyalias` intra-doc link disambiguator

Fixes rust-lang/rust#146855.

Alternative to rust-lang/rust#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc intra-doc link: cannot disambiguate between primitive and type alias
5 participants